#include<iostream>
#include <string>
using namespace std;

class Dog
{
    public:
        string name;
        /*第一个类内函数*/
        void getWeight(int weight){
            cout << name << "的体重是" << weight << "KG" << endl;
        }

        /*重载一个函数，函数名一样，但参数不同*/
        void getWeight(double weight){
        cout << name << "的体重是" << weight << "KG" << endl;
        }
};

int main()
{
    Dog dog;
    dog.name = "旺财";
    dog.getWeight(10);
    dog.getWeight(10.56);
    return 0;

}

/*
运行结果：
    旺财的体重是10KG
    旺财的体重是10.56KG
*/
